package com.kikt.recyclerview.loadmore.api

import com.google.gson.annotations.SerializedName
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

/**
 * Created by cai on 2017/10/27.
 */
interface GoodApi {

    @FormUrlEncoded
    @POST("m=goods&a=getList")
    fun getHomeData(@Field("uid") uid: String = "", @Field("keyword") keyword: String): HomeResp
}

data class HomeResp(
        @SerializedName("data") val data: List<Data>,
        @SerializedName("pageCount") val pageCount: Int, //207
        @SerializedName("page") val page: Int //1
) {
    data class Data(
            @SerializedName("name") val name: String, //小香葱
            @SerializedName("small_logo") val smallLogo: String, //http://www.sxw365.com/upload/17/03/13/15494863283792.jpg
            @SerializedName("logo") val logo: String, //http://www.sxw365.com/upload/17/03/13/15494863131593.jpg
            @SerializedName("sale_price") val salePrice: String, //-
            @SerializedName("unit") val unit: String, //斤
            @SerializedName("spec") val spec: String, //散装（普通）
            @SerializedName("remark") val remark: String, //水洗菜，质地柔嫩，味清香，带少量水，叶面绿色，有少许黄叶，因季节原因会有起苔现象出现，不影响食用
            @SerializedName("isvalid") val isvalid: String //0
    )
}
